package com.naizhuai.network.apistore;

import android.support.annotation.CheckResult;

import com.naizhuai.network.Config;
import com.naizhuai.network.entity.ResultResponse;
import com.naizhuai.ui.entity.ImageBean;

import java.util.List;
import java.util.Map;

import okhttp3.MultipartBody;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import rx.Observable;

/**
 * Created by code_han on 2018/3/28.
 * 下载图片文件的网络接口调用
 */
public interface UploadImageRequest {

    //上传多个文件以及多个参数
    @Multipart
    @POST(Config.UPLOAD_IMAGES)
    @CheckResult
    Observable<ResultResponse<List<ImageBean>>> uploadImgs(@PartMap() Map<String, String> map, @Part List<MultipartBody.Part> parts);


    //上传单个文件以及多个参数
    @Multipart
    @POST(Config.USER_UPLOAD_IMG)
    @CheckResult
    Observable<ResultResponse<ImageBean>> uploadImg(@PartMap() Map<String, String> map, @Part MultipartBody.Part part);
}
